package _021_10_8

func FindNumbersWithSum(array []int, sum int) []int {
	dataMap := make(map[int]int)
	for i := 0; i < len(array); i++ {
		dataMap[array[i]] = array[i]
	}

	for i, _ := range dataMap {
		temp := sum - i
		_, ok := dataMap[temp]
		if ok {
			return []int{
				i, temp,
			}
		}
	}
	return []int{}
}
